#include "compiler.h"

const char *filename = 0;

extern void args_on(char *what);
extern void args_off(char *what);
extern void args_switch(char *what);
extern void args_init();
extern void compile();

static void parse(char *arg)
{
	if (arg[0] == '+') {
		args_on(arg+1);
	} else if (arg[0] == '-') {
		args_off(arg+1);
	} else if (arg[0] == '/') {
		args_switch(arg+1);
	} else {
		filename = arg;
	}
}

int main(int argc, char **argv)
{
	int i;

	args_init();

	for (i = 1; i < argc; i++) {
		parse(argv[i]);
	}

	if (filename == 0) {
		ERROR("No file specified %s", "", ERROR_ARGS);
	}

	compile();

	return 0;
}